package com.jiangxjsy.core.common;

import com.jiangxjsy.core.constant.AdminRoleTypeConstant;
import lombok.Getter;

/**
 * wukong-crm-master
 * 蒋胜宇
 * 2025/6/11 18:44
 */

@Getter
public enum AdminRoleType {
    CUSTOM(AdminRoleTypeConstant.CUSTOM),
    MANAGER(AdminRoleTypeConstant.MANAGER),
    CUSTOMER_MANAGER(AdminRoleTypeConstant.CUSTOMER_MANAGER),
    PERSONNEL(AdminRoleTypeConstant.PERSONNEL),
    FINANCE(AdminRoleTypeConstant.FINANCE),
    WORK(AdminRoleTypeConstant.WORK),
    OA(AdminRoleTypeConstant.OA),
    PROJECT(AdminRoleTypeConstant.PROJECT),
    HRM(AdminRoleTypeConstant.HRM),
    JXC(AdminRoleTypeConstant.JXC);

    private final Integer role;

    AdminRoleType(Integer role) {
        this.role = role;
    }

    public static AdminRoleType valueOf(Integer role) {
        for (AdminRoleType value : values()) {
            if (value.role.equals(role)) {
                return value;
            }
        }
        return null;
    }
}
